#pragma once

// Dependencies
#include "Rect2.h"
#include "Point2.h"

// Manages viewport and world window
// Sets up OpenGL matrices appropriately
class Canvas {
public: // Canvas
	Canvas();

public: // Methods
	void clear();
	void present();
	void setup();
	Point2 toWorld( const Point2i& pt ) const;
	Point2i toScreen( const Point2& pt ) const;
public: // Mutators
	void setViewport( const Rect2i& rect );
	void setWorldWindow( const Rect2& view );
	void setWorldWindow( const Point2& focus, double scale, double aspect = 1. );

public: // Accessors
	double getAspectRatio() const;
	const Rect2i& getViewport() const;
	const Rect2& getWorldWindow() const;

private: // Members
	Rect2i mViewport;
	Rect2 mWorldWindow;
};